﻿using Microsoft.AspNetCore.Mvc;

namespace AppServer
{
    public interface IImageHandler
    {
         Task<IActionResult> UploadImage(IFormFile file);
    }

    public class ImageHandler : IImageHandler
    {
        readonly IImageWriter _imageWriter;

        public ImageHandler (IImageWriter imageWriter)
        {
            this._imageWriter = imageWriter;
        }

        public async Task<IActionResult> UploadImage(IFormFile file)
        {
            var result = await _imageWriter.UploadImage(file,"test");
            return new ObjectResult(result);
        }
    }
}
